package com.jianzh5.type;

/**
 * FileName：com.jianzh5.type.StaticTypeEnum
 * Description：
 * Author:jianzhang11
 * Date:2016/9/26 10:01
 */
public enum StaticTypeEnum {
    AboutUs(1,"关于我们"),
    IntroduceUs(2,"联系我们");

    private final int key;
    private final String value;

    StaticTypeEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static StaticTypeEnum getType(int key){
        for(StaticTypeEnum st : StaticTypeEnum.values()){
            if(key == st.key){
                return st;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        StaticTypeEnum SE = getType(1);
        System.out.println(SE.getValue());
    }
}
